window.addEventListener('load', function() {
    // tab切换功能
    let projectNames = this.document.querySelector('.select ul')
    let lis = projectNames.querySelectorAll('li')
    projectNames.addEventListener('click', function(e) {
        //获取点击分类
        lis.forEach((item) => {
            item.className = ''
        })
        e.target.classList.add('cur');
        let projectVal = e.target.innerText
        let projects = document.querySelectorAll('.curriculum-item')
        if (projectVal === '全部') {
            //全部显示
            projects.forEach((item) => {
                item.style.display = 'block'
            })
        } else { //不是全部，匹配遍历
            projects.forEach((item) => {
                let isHave = item.innerText.indexOf(projectVal)
                if (isHave !== -1) {
                    item.style.display = 'block'
                } else {
                    item.style.display = 'none'
                }
            })
        }
    })


})